﻿//
(function() {

// insert your plugin name here
// eg : var mypluginname = 'label';

var mypluginname = 'legend';

$(window).data('gui').plugins[mypluginname] =
{

  // makeHTML is called to create the html elements
  // options are in your ui.xml
  makeHTML : function(param)
  {
    /*
    options['titlebar-fixe'];
    */

    var obj = document.createElement("legend"); // don't erase
    // obj.setAttribute('data-type', mypluginname);  // deprecied, uncomment if u make a window plugin
	param.parent.appendChild(obj);
	
	obj.setAttribute('data-effect','legend');
	guiTareNameSpace.executeChildrensPlugin(param.xml,obj);
    return obj; // don't erase
		// return null if error
  },

	 // this api can make a button element in your ui.xml
  // for the future gui creator
  // return a element or null if error
  makeXML : function(xml)
  {
		var element = xml.ownerDocument.createElement(mypluginname); // don't erase

		$(element).text(this.text());
		return element; // don't erase
		// return null if error
  },

	text : function(txt)
	{
		if (txt !== undefined && txt !== null) {
			this.jquery.text(txt);
			return this;
		}
		return this.jquery.text();
	}
  }
})();